﻿using System;
using System.Diagnostics.Contracts;

namespace DaveSexton.Labs
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
	[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes",
		Justification = "The DisplayName property is virtual to support localization, similar to System.ComponentModel.DisplayNameAttribute.")]
	public class ExperimentAttribute : Attribute
	{
		#region Public Properties
		public virtual string DisplayName
		{
			get
			{
				Contract.Ensures(Contract.Result<string>() != null);

				return displayName ?? string.Empty;
			}
		}
		#endregion

		#region Private / Protected
		private readonly string displayName;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ExperimentAttribute" /> class.
		/// </summary>
		public ExperimentAttribute()
		{
		}

		/// <summary>
		/// Constructs a new instance of the <see cref="ExperimentAttribute" /> class.
		/// </summary>
		public ExperimentAttribute(string displayName)
		{
			this.displayName = displayName;
		}
		#endregion

		#region Methods

		#endregion
	}
}